package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        File file = new File("./demo.txt");// ./表示当前目录，相对路径。
        long len = file.length();
        System.out.println(len + "个字节");
        String name = file.getName();
        System.out.println("文件名：" + name);
        boolean b = file.canRead();
        System.out.println("是否可读：" + b);
        boolean b1 = file.canWrite();
        System.out.println("是否可写：" + b1);
        boolean hidden = file.isHidden();
        System.out.println("是否隐藏：" + hidden);
    }

}
